Postnatal environmental exposures, particularly those found in household products and dietary intake, along with specific serum metabolomics profiles, are significantly associated with the BMI Z-score of children aged 6-11 years. Higher concentrations of certain metabolites in serum, reflecting exposure to chemical classes or metals, will correlate with variations in BMI Z-score, controlling for age and other relevant covariates. High-dimensional metabolomics data can reveal comprehensive biochemical profiles that reflect environmental exposures and metabolic states. Not only that, but some metabolites associated with chemical exposures and dietary patterns can serve as biomarkers for the risk of developing obesity.
Research indicates that postnatal exposure to endocrine-disrupting chemicals (EDCs) such as phthalates, bisphenol A (BPA), and polychlorinated biphenyls (PCBs) can significantly influence body weight and metabolic health (Junge et al., 2018). These chemicals, commonly found in household products and absorbed through dietary intake, are linked to detrimental effects on body weight and metabolic health in children. This hormonal interference can lead to an increased body mass index (BMI) in children, suggesting a potential pathway through which exposure to these chemicals contributes to the development of obesity.
A longitudinal study on Japanese children examined the impact of postnatal exposure (first two years of life) to p,p’-dichlorodiphenyltrichloroethane (p,p’-DDT) and p,p’-dichlorodiphenyldichloroethylene (p,p’-DDE) through breastfeeding (Plouffe et al., 2020). The findings revealed that higher levels of these chemicals in breast milk were associated with increased BMI at 42 months of age. DDT and DDE may interfere with hormonal pathways related to growth and development. These chemicals can mimic or disrupt hormones that regulate metabolism and fat accumulation. This study highlights the importance of understanding how persistent organic pollutants can affect early childhood growth and development.
The study by Harley et al. (2013) investigates the association between prenatal and postnatal Bisphenol A (BPA) exposure and various body composition metrics in children aged 9 years from the CHAMACOS cohort. The study found that higher prenatal BPA exposure was linked to a decrease in BMI and body fat percentages in girls but not boys, suggesting sex-specific effects. Conversely, BPA levels measured at age 9 were positively associated with increased adiposity in both genders, highlighting the different impacts of exposure timing on childhood development.
The 2022 study 2022 study by Uldbjerg et al. explored the effects of combined exposures to multiple EDCs, suggesting that mixtures of these chemicals can have additive or synergistic effects on BMI and obesity risk. Humans are typically exposed to a mixture of chemicals rather than individual EDCs, making it crucial to understand how these mixtures might interact. The research highlighted that the interaction between different EDCs can lead to additive (where the effects simply add up) or even synergistic (where the combined effect is greater than the sum of their separate effects) outcomes. These interactions can significantly amplify the risk factors associated with obesity and metabolic disorders in children. The dose-response relationship found that even low-level exposure to multiple EDCs could result in significant health impacts due to their combined effects.
These studies collectively illustrate the critical role of environmental EDCs in shaping metabolic health outcomes in children, highlighting the necessity for ongoing research and policy intervention to mitigate these risks.
This study will utilize data from the subcohort of 1301 mother-child pairs in the HELIX study, who are which aged 6-11 years for whom complete exposure and outcome data were available. Exposure data included detailed dietary records after pregnancy and concentrations of various chemicals like BPA and PCBs in child blood samples. There are categorical and numerical variables, which will include both demographic details and biochemical measurements. This dataset allows for robust statistical analysis to identify potential associations between EDC exposure and changes in BMI Z-scores, considering confounding factors such as age, gender, and socioeconomic status. There are no missing data so there is not need to impute the information. Child BMI Z-scores were calculated based on WHO growth standards.
load("/Users/allison/Library/CloudStorage/GoogleDrive-aflouie@usc.edu/My Drive/HELIX_data/HELIX.RData")
filtered_codebook <- codebook %>%
filter(domain %in% c("Chemicals", "Lifestyles") & period == "Postnatal" & subfamily != "Allergens")
kable(filtered_codebook, align = "c", format = "html") %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed"), full_width = F)
| variable_name | domain | family | subfamily | period | location | period_postnatal | description | var_type | transformation | labels | labelsshort | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| h_bfdur_Ter | h_bfdur_Ter | Lifestyles | Lifestyle | Diet | Postnatal | NA | NA | Breastfeeding duration (weeks) | factor | Tertiles | Breastfeeding | Breastfeeding |
| hs_bakery_prod_Ter | hs_bakery_prod_Ter | Lifestyles | Lifestyle | Diet | Postnatal | NA | NA | Food group: bakery products (hs_cookies + hs_pastries) | factor | Tertiles | Bakery prod | BakeProd |
| hs_beverages_Ter | hs_beverages_Ter | Lifestyles | Lifestyle | Diet | Postnatal | NA | NA | Food group: beverages (hs_dietsoda+hs_soda) | factor | Tertiles | Soda | Soda |
| hs_break_cer_Ter | hs_break_cer_Ter | Lifestyles | Lifestyle | Diet | Postnatal | NA | NA | Food group: breakfast cereal (hs_sugarcer+hs_othcer) | factor | Tertiles | BF cereals | BFcereals |
| hs_caff_drink_Ter | hs_caff_drink_Ter | Lifestyles | Lifestyle | Diet | Postnatal | NA | NA | Drinks a caffeinated or æenergy drink (eg coca-cola, diet-coke, redbull) | factor | Tertiles | Caffeine | Caffeine |
| hs_dairy_Ter | hs_dairy_Ter | Lifestyles | Lifestyle | Diet | Postnatal | NA | NA | Food group: dairy (hs_cheese + hs_milk + hs_yogurt+ hs_probiotic+ hs_desert) | factor | Tertiles | Dairy | Dairy |
| hs_fastfood_Ter | hs_fastfood_Ter | Lifestyles | Lifestyle | Diet | Postnatal | NA | NA | Visits a fast food restaurant/take away | factor | Tertiles | Fastfood | Fastfood |
| hs_KIDMED_None | hs_KIDMED_None | Lifestyles | Lifestyle | Diet | Postnatal | NA | NA | Sum of KIDMED indices, without index9 | numeric | None | KIDMED | KIDMED |
| hs_mvpa_prd_alt_None | hs_mvpa_prd_alt_None | Lifestyles | Lifestyle | Physical activity | Postnatal | NA | NA | Clean & Over-reporting of Moderate-to-Vigorous Physical Activity (min/day) | numeric | None | PA | PA |
| hs_org_food_Ter | hs_org_food_Ter | Lifestyles | Lifestyle | Diet | Postnatal | NA | NA | Eats organic food | factor | Tertiles | Organicfood | Organicfood |
| hs_proc_meat_Ter | hs_proc_meat_Ter | Lifestyles | Lifestyle | Diet | Postnatal | NA | NA | Food group: processed meat (hs_coldmeat+hs_ham) | factor | Tertiles | Processed meat | ProcMeat |
| hs_readymade_Ter | hs_readymade_Ter | Lifestyles | Lifestyle | Diet | Postnatal | NA | NA | Eats a æready-made supermarket meal | factor | Tertiles | Ready made food | ReadyFood |
| hs_sd_wk_None | hs_sd_wk_None | Lifestyles | Lifestyle | Physical activity | Postnatal | NA | NA | sedentary behaviour (min/day) | numeric | None | Sedentary | Sedentary |
| hs_total_bread_Ter | hs_total_bread_Ter | Lifestyles | Lifestyle | Diet | Postnatal | NA | NA | Food group: bread (hs_darkbread+hs_whbread) | factor | Tertiles | Bread | Bread |
| hs_total_cereal_Ter | hs_total_cereal_Ter | Lifestyles | Lifestyle | Diet | Postnatal | NA | NA | Food group: cereal (hs_darkbread + hs_whbread + hs_rice_pasta + hs_sugarcer + hs_othcer + hs_rusks) | factor | Tertiles | Cereals | Cereals |
| hs_total_fish_Ter | hs_total_fish_Ter | Lifestyles | Lifestyle | Diet | Postnatal | NA | NA | Food group: fish and seafood (hs_canfish+hs_oilyfish+hs_whfish+hs_seafood) | factor | Tertiles | Fish | Fish |
| hs_total_fruits_Ter | hs_total_fruits_Ter | Lifestyles | Lifestyle | Diet | Postnatal | NA | NA | Food group: fruits (hs_canfruit+hs_dryfruit+hs_freshjuice+hs_fruits) | factor | Tertiles | Fruits | Fruits |
| hs_total_lipids_Ter | hs_total_lipids_Ter | Lifestyles | Lifestyle | Diet | Postnatal | NA | NA | Food group: Added fat | factor | Tertiles | Diet fat | Diet fat |
| hs_total_meat_Ter | hs_total_meat_Ter | Lifestyles | Lifestyle | Diet | Postnatal | NA | NA | Food group: meat (hs_coldmeat+hs_ham+hs_poultry+hs_redmeat) | factor | Tertiles | Meat | Meat |
| hs_total_potatoes_Ter | hs_total_potatoes_Ter | Lifestyles | Lifestyle | Diet | Postnatal | NA | NA | Food group: potatoes (hs_frenchfries+hs_potatoes) | factor | Tertiles | Potatoes | Potatoes |
| hs_total_sweets_Ter | hs_total_sweets_Ter | Lifestyles | Lifestyle | Diet | Postnatal | NA | NA | Food group: sweets (hs_choco + hs_sweets + hs_sugar) | factor | Tertiles | Sweets | Sweets |
| hs_total_veg_Ter | hs_total_veg_Ter | Lifestyles | Lifestyle | Diet | Postnatal | NA | NA | Food group: vegetables (hs_cookveg+hs_rawveg) | factor | Tertiles | Vegetables | Vegetables |
| hs_total_yog_Ter | hs_total_yog_Ter | Lifestyles | Lifestyle | Diet | Postnatal | NA | NA | Food group: yogurt (hs_yogurt+hs_probiotic) | factor | Tertiles | Yogurt | Yogurt |
| hs_dif_hours_total_None | hs_dif_hours_total_None | Lifestyles | Lifestyle | Sleep | Postnatal | NA | NA | Total hours of sleep (mean weekdays and night) | numeric | None | Sleep | Sleep |
| hs_as_c_Log2 | hs_as_c_Log2 | Chemicals | Metals | As | Postnatal | NA | NA | Arsenic (As) in child | numeric | Logarithm base 2 | As | As |
| hs_cd_c_Log2 | hs_cd_c_Log2 | Chemicals | Metals | Cd | Postnatal | NA | NA | Cadmium (Cd) in child | numeric | Logarithm base 2 | Cd | Cd |
| hs_co_c_Log2 | hs_co_c_Log2 | Chemicals | Metals | Co | Postnatal | NA | NA | Cobalt (Co) in child | numeric | Logarithm base 2 | Co | Co |
| hs_cs_c_Log2 | hs_cs_c_Log2 | Chemicals | Metals | Cs | Postnatal | NA | NA | Caesium (Cs) in child | numeric | Logarithm base 2 | Cs | Cs |
| hs_cu_c_Log2 | hs_cu_c_Log2 | Chemicals | Metals | Cu | Postnatal | NA | NA | Copper (Cu) in child | numeric | Logarithm base 2 | Cu | Cu |
| hs_hg_c_Log2 | hs_hg_c_Log2 | Chemicals | Metals | Hg | Postnatal | NA | NA | Mercury (Hg) in child | numeric | Logarithm base 2 | Hg | Hg |
| hs_mn_c_Log2 | hs_mn_c_Log2 | Chemicals | Metals | Mn | Postnatal | NA | NA | Manganese (Mn) in child | numeric | Logarithm base 2 | Mn | Mn |
| hs_mo_c_Log2 | hs_mo_c_Log2 | Chemicals | Metals | Mo | Postnatal | NA | NA | Molybdenum (Mo) in child | numeric | Logarithm base 2 | Mo | Mo |
| hs_pb_c_Log2 | hs_pb_c_Log2 | Chemicals | Metals | Pb | Postnatal | NA | NA | Lead (Pb) in child | numeric | Logarithm base 2 | Pb | Pb |
| hs_tl_cdich_None | hs_tl_cdich_None | Chemicals | Metals | Tl | Postnatal | NA | NA | Dichotomous variable of thallium (Tl) in child | factor | None | Tl | Tl |
| hs_dde_cadj_Log2 | hs_dde_cadj_Log2 | Chemicals | Organochlorines | DDE | Postnatal | NA | NA | Dichlorodiphenyldichloroethylene (DDE) in child adjusted for lipids | numeric | Logarithm base 2 | DDE | DDE |
| hs_ddt_cadj_Log2 | hs_ddt_cadj_Log2 | Chemicals | Organochlorines | DDT | Postnatal | NA | NA | Dichlorodiphenyltrichloroethane (DDT) in child adjusted for lipids | numeric | Logarithm base 2 | DDT | DDT |
| hs_hcb_cadj_Log2 | hs_hcb_cadj_Log2 | Chemicals | Organochlorines | HCB | Postnatal | NA | NA | Hexachlorobenzene (HCB) in child adjusted for lipids | numeric | Logarithm base 2 | HCB | HCB |
| hs_pcb118_cadj_Log2 | hs_pcb118_cadj_Log2 | Chemicals | Organochlorines | PCBs | Postnatal | NA | NA | Polychlorinated biphenyl -118 (PCB-118) in child adjusted for lipids | numeric | Logarithm base 2 | PCB 118 | PCB118 |
| hs_pcb138_cadj_Log2 | hs_pcb138_cadj_Log2 | Chemicals | Organochlorines | PCBs | Postnatal | NA | NA | Polychlorinated biphenyl-138 (PCB-138) in child adjusted for lipids | numeric | Logarithm base 2 | PCB 138 | PCB138 |
| hs_pcb153_cadj_Log2 | hs_pcb153_cadj_Log2 | Chemicals | Organochlorines | PCBs | Postnatal | NA | NA | Polychlorinated biphenyl-153 (PCB-153) in child adjusted for lipids | numeric | Logarithm base 2 | PCB 153 | PCB153 |
| hs_pcb170_cadj_Log2 | hs_pcb170_cadj_Log2 | Chemicals | Organochlorines | PCBs | Postnatal | NA | NA | Polychlorinated biphenyl-170 (PCB-170) in child adjusted for lipids | numeric | Logarithm base 2 | PCB 170 | PCB170 |
| hs_pcb180_cadj_Log2 | hs_pcb180_cadj_Log2 | Chemicals | Organochlorines | PCBs | Postnatal | NA | NA | Polychlorinated biphenyl-180 (PCB-180) in child adjusted for lipids | numeric | Logarithm base 2 | PCB 180 | PCB180 |
| hs_sumPCBs5_cadj_Log2 | hs_sumPCBs5_cadj_Log2 | Chemicals | Organochlorines | PCBs | Postnatal | NA | NA | Sum of PCBs in child adjusted for lipids (4 cohorts) | numeric | Logarithm base 2 | PCBs | SumPCB |
| hs_dep_cadj_Log2 | hs_dep_cadj_Log2 | Chemicals | Organophosphate pesticides | DEP | Postnatal | NA | NA | Diethyl phosphate (DEP) in child adjusted for creatinine | numeric | Logarithm base 2 | DEP | DEP |
| hs_detp_cadj_Log2 | hs_detp_cadj_Log2 | Chemicals | Organophosphate pesticides | DETP | Postnatal | NA | NA | Diethyl thiophosphate (DETP) in child adjusted for creatinine | numeric | Logarithm base 2 | DETP | DETP |
| hs_dmdtp_cdich_None | hs_dmdtp_cdich_None | Chemicals | Organophosphate pesticides | DMDTP | Postnatal | NA | NA | Dichotomous variable of dimethyl dithiophosphate (DMDTP) in child | factor | None | DMDTP | DMDTP |
| hs_dmp_cadj_Log2 | hs_dmp_cadj_Log2 | Chemicals | Organophosphate pesticides | DMP | Postnatal | NA | NA | Dimethyl phosphate (DMP) in child adjusted for creatinine | numeric | Logarithm base 2 | DMP | DMP |
| hs_dmtp_cadj_Log2 | hs_dmtp_cadj_Log2 | Chemicals | Organophosphate pesticides | DMTP | Postnatal | NA | NA | Dimethyl thiophosphate (DMTP) in child adjusted for creatinine | numeric | Logarithm base 2 | DMDTP | DMTP |
| hs_pbde153_cadj_Log2 | hs_pbde153_cadj_Log2 | Chemicals | Polybrominated diphenyl ethers (PBDE) | PBDE153 | Postnatal | NA | NA | Polybrominated diphenyl ether-153 (PBDE-153) in child adjusted for lipids | numeric | Logarithm base 2 | PBDE 153 | PBDE153 |
| hs_pbde47_cadj_Log2 | hs_pbde47_cadj_Log2 | Chemicals | Polybrominated diphenyl ethers (PBDE) | PBDE47 | Postnatal | NA | NA | Polybrominated diphenyl ether-47 (PBDE-47) in child adjusted for lipids | numeric | Logarithm base 2 | PBDE 47 | PBDE47 |
| hs_pfhxs_c_Log2 | hs_pfhxs_c_Log2 | Chemicals | Per- and polyfluoroalkyl substances (PFAS) | PFHXS | Postnatal | NA | NA | Perfluorohexane sulfonate (PFHXS) in child | numeric | Logarithm base 2 | PFHXS | PFHXS |
| hs_pfna_c_Log2 | hs_pfna_c_Log2 | Chemicals | Per- and polyfluoroalkyl substances (PFAS) | PFNA | Postnatal | NA | NA | Perfluorononanoate (PFNA) in child | numeric | Logarithm base 2 | PFNA | PFNA |
| hs_pfoa_c_Log2 | hs_pfoa_c_Log2 | Chemicals | Per- and polyfluoroalkyl substances (PFAS) | PFOA | Postnatal | NA | NA | Perfluorooctanoate (PFOA) in child | numeric | Logarithm base 2 | PFOA | PFOA |
| hs_pfos_c_Log2 | hs_pfos_c_Log2 | Chemicals | Per- and polyfluoroalkyl substances (PFAS) | PFOS | Postnatal | NA | NA | Perfluorooctane sulfonate (PFOS) in child | numeric | Logarithm base 2 | PFOS | PFOS |
| hs_pfunda_c_Log2 | hs_pfunda_c_Log2 | Chemicals | Per- and polyfluoroalkyl substances (PFAS) | PFUNDA | Postnatal | NA | NA | Perfluoroundecanoate (PFUNDA) in child | numeric | Logarithm base 2 | PFUNDA | PFUNDA |
| hs_bpa_cadj_Log2 | hs_bpa_cadj_Log2 | Chemicals | Phenols | BPA | Postnatal | NA | NA | Bisphenol A (BPA) in child adjusted for creatinine | numeric | Logarithm base 2 | BPA | BPA |
| hs_bupa_cadj_Log2 | hs_bupa_cadj_Log2 | Chemicals | Phenols | BUPA | Postnatal | NA | NA | N-Butyl paraben (BUPA) in child adjusted for creatinine | numeric | Logarithm base 2 | BUPA | BUPA |
| hs_etpa_cadj_Log2 | hs_etpa_cadj_Log2 | Chemicals | Phenols | ETPA | Postnatal | NA | NA | Ethyl paraben (ETPA) in child adjusted for creatinine | numeric | Logarithm base 2 | ETPA | ETPA |
| hs_mepa_cadj_Log2 | hs_mepa_cadj_Log2 | Chemicals | Phenols | MEPA | Postnatal | NA | NA | Methyl paraben (MEPA) in child adjusted for creatinine | numeric | Logarithm base 2 | MEPA | MEPA |
| hs_oxbe_cadj_Log2 | hs_oxbe_cadj_Log2 | Chemicals | Phenols | OXBE | Postnatal | NA | NA | Oxybenzone (OXBE) in child adjusted for creatinine | numeric | Logarithm base 2 | OXBE | OXBE |
| hs_prpa_cadj_Log2 | hs_prpa_cadj_Log2 | Chemicals | Phenols | PRPA | Postnatal | NA | NA | Propyl paraben (PRPA) in child adjusted for creatinine | numeric | Logarithm base 2 | PRPA | PRPA |
| hs_trcs_cadj_Log2 | hs_trcs_cadj_Log2 | Chemicals | Phenols | TRCS | Postnatal | NA | NA | Triclosan (TRCS) in child adjusted for creatinine | numeric | Logarithm base 2 | TRCS | TRCS |
| hs_mbzp_cadj_Log2 | hs_mbzp_cadj_Log2 | Chemicals | Phthalates | MBZP | Postnatal | NA | NA | Mono benzyl phthalate (MBzP) in child adjusted for creatinine | numeric | Logarithm base 2 | MBZP | MBZP |
| hs_mecpp_cadj_Log2 | hs_mecpp_cadj_Log2 | Chemicals | Phthalates | MECPP | Postnatal | NA | NA | Mono-2-ethyl 5-carboxypentyl phthalate (MECPP) in child adjusted for creatinine | numeric | Logarithm base 2 | MECPP | MECPP |
| hs_mehhp_cadj_Log2 | hs_mehhp_cadj_Log2 | Chemicals | Phthalates | MEHHP | Postnatal | NA | NA | Mono-2-ethyl-5-hydroxyhexyl phthalate (MEHHP) in child adjusted for creatinine | numeric | Logarithm base 2 | MEHHP | MEHHP |
| hs_mehp_cadj_Log2 | hs_mehp_cadj_Log2 | Chemicals | Phthalates | MEHP | Postnatal | NA | NA | Mono-2-ethylhexyl phthalate (MEHP) in child adjusted for creatinine | numeric | Logarithm base 2 | MEHP | MEHP |
| hs_meohp_cadj_Log2 | hs_meohp_cadj_Log2 | Chemicals | Phthalates | MEOHP | Postnatal | NA | NA | Mono-2-ethyl-5-oxohexyl phthalate (MEOHP) in child adjusted for creatinine | numeric | Logarithm base 2 | MEOHP | MEOHP |
| hs_mep_cadj_Log2 | hs_mep_cadj_Log2 | Chemicals | Phthalates | MEP | Postnatal | NA | NA | Monoethyl phthalate (MEP) in child adjusted for creatinine | numeric | Logarithm base 2 | MEP | MEP |
| hs_mibp_cadj_Log2 | hs_mibp_cadj_Log2 | Chemicals | Phthalates | MIBP | Postnatal | NA | NA | Mono-iso-butyl phthalate (MiBP) in child adjusted for creatinine | numeric | Logarithm base 2 | MIBP | MIBP |
| hs_mnbp_cadj_Log2 | hs_mnbp_cadj_Log2 | Chemicals | Phthalates | MNBP | Postnatal | NA | NA | Mono-n-butyl phthalate (MnBP) in child adjusted for creatinine | numeric | Logarithm base 2 | MNBP | MNBP |
| hs_ohminp_cadj_Log2 | hs_ohminp_cadj_Log2 | Chemicals | Phthalates | OHMiNP | Postnatal | NA | NA | Mono-4-methyl-7-hydroxyoctyl phthalate (OHMiNP) in child adjusted for creatinine | numeric | Logarithm base 2 | OHMiNP | OHMiNP |
| hs_oxominp_cadj_Log2 | hs_oxominp_cadj_Log2 | Chemicals | Phthalates | OXOMINP | Postnatal | NA | NA | Mono-4-methyl-7-oxooctyl phthalate (OXOMiNP) in child adjusted for creatinine | numeric | Logarithm base 2 | OXOMINP | OXOMINP |
| hs_sumDEHP_cadj_Log2 | hs_sumDEHP_cadj_Log2 | Chemicals | Phthalates | DEHP | Postnatal | NA | NA | Sum of DEHP metabolites (µg/g) in child adjusted for creatinine | numeric | Logarithm base 2 | DEHP | SumDEHP |
| FAS_cat_None | FAS_cat_None | Chemicals | Social and economic capital | Economic capital | Postnatal | NA | NA | Family affluence score | factor | None | Family affluence | FamAfl |
| hs_contactfam_3cat_num_None | hs_contactfam_3cat_num_None | Chemicals | Social and economic capital | Social capital | Postnatal | NA | NA | scoial capital: family friends | factor | None | Social contact | SocCont |
| hs_hm_pers_None | hs_hm_pers_None | Chemicals | Social and economic capital | Social capital | Postnatal | NA | NA | How many people live in your home? | numeric | None | House crowding | HouseCrow |
| hs_participation_3cat_None | hs_participation_3cat_None | Chemicals | Social and economic capital | Social capital | Postnatal | NA | NA | social capital: structural | factor | None | Social participation | SocPartic |
| hs_cotinine_cdich_None | hs_cotinine_cdich_None | Chemicals | Tobacco Smoke | Cotinine | Postnatal | NA | NA | Dichotomous variable of cotinine in child | factor | None | Cotinine | Cotinine |
| hs_globalexp2_None | hs_globalexp2_None | Chemicals | Tobacco Smoke | Tobacco Smoke | Postnatal | NA | NA | Global exposure of the child to ETS (2 categories) | factor | None | ETS | ETS |
| hs_smk_parents_None | hs_smk_parents_None | Chemicals | Tobacco Smoke | Tobacco Smoke | Postnatal | NA | NA | Tobacco Smoke status of parents (both) | factor | None | Smoking_parents | SmokPar |
Lifestyle_Exposures <- filtered_codebook$variable_name[filtered_codebook$domain=="Lifestyles"]
lifestyle_exposome <- exposome %>%
select(all_of(Lifestyle_Exposures))
summarytools::view(dfSummary(lifestyle_exposome, style = 'grid', plain.ascii = FALSE, valid.col = FALSE, headings = FALSE), method = "render")
| No | Variable | Stats / Values | Freqs (% of Valid) | Graph | Missing | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | h_bfdur_Ter [factor] |
|
|
0 (0.0%) | ||||||||||||||||
| 2 | hs_bakery_prod_Ter [factor] |
|
|
0 (0.0%) | ||||||||||||||||
| 3 | hs_beverages_Ter [factor] |
|
|
0 (0.0%) | ||||||||||||||||
| 4 | hs_break_cer_Ter [factor] |
|
|
0 (0.0%) | ||||||||||||||||
| 5 | hs_caff_drink_Ter [factor] |
|
|
0 (0.0%) | ||||||||||||||||
| 6 | hs_dairy_Ter [factor] |
|
|
0 (0.0%) | ||||||||||||||||
| 7 | hs_fastfood_Ter [factor] |
|
|
0 (0.0%) | ||||||||||||||||
| 8 | hs_KIDMED_None [numeric] |
|
13 distinct values | 0 (0.0%) | ||||||||||||||||
| 9 | hs_mvpa_prd_alt_None [numeric] |
|
847 distinct values | 0 (0.0%) | ||||||||||||||||
| 10 | hs_org_food_Ter [factor] |
|
|
0 (0.0%) | ||||||||||||||||
| 11 | hs_proc_meat_Ter [factor] |
|
|
0 (0.0%) | ||||||||||||||||
| 12 | hs_readymade_Ter [factor] |
|
|
0 (0.0%) | ||||||||||||||||
| 13 | hs_sd_wk_None [numeric] |
|
368 distinct values | 0 (0.0%) | ||||||||||||||||
| 14 | hs_total_bread_Ter [factor] |
|
|
0 (0.0%) | ||||||||||||||||
| 15 | hs_total_cereal_Ter [factor] |
|
|
0 (0.0%) | ||||||||||||||||
| 16 | hs_total_fish_Ter [factor] |
|
|
0 (0.0%) | ||||||||||||||||
| 17 | hs_total_fruits_Ter [factor] |
|
|
0 (0.0%) | ||||||||||||||||
| 18 | hs_total_lipids_Ter [factor] |
|
|
0 (0.0%) | ||||||||||||||||
| 19 | hs_total_meat_Ter [factor] |
|
|
0 (0.0%) | ||||||||||||||||
| 20 | hs_total_potatoes_Ter [factor] |
|
|
0 (0.0%) | ||||||||||||||||
| 21 | hs_total_sweets_Ter [factor] |
|
|
0 (0.0%) | ||||||||||||||||
| 22 | hs_total_veg_Ter [factor] |
|
|
0 (0.0%) | ||||||||||||||||
| 23 | hs_total_yog_Ter [factor] |
|
|
0 (0.0%) | ||||||||||||||||
| 24 | hs_dif_hours_total_None [numeric] |
|
437 distinct values | 0 (0.0%) |
Generated by summarytools 1.0.1 (R version 4.4.0)
2024-06-17
#separate numeric and categorical data
numeric_lifestyle <- lifestyle_exposome %>%
select(where(is.numeric))
numeric_lifestyle_long <- pivot_longer(
numeric_lifestyle,
cols = everything(),
names_to = "variable",
values_to = "value"
)
unique_numerical_vars <- unique(numeric_lifestyle_long$variable)
num_plots <- lapply(unique_numerical_vars, function(var) {
data <- filter(numeric_lifestyle_long, variable == var)
p <- ggplot(data, aes(x = value)) +
geom_histogram(bins = 30, fill = "blue") +
labs(title = paste("Histogram of", var), x = "Value", y = "Count")
print(p)
return(p)
})
The Sum of KIDMED indices, without index9 histogram displays a multimodal distribution with peaks primarily at scores 0, 3, 5, 7, and 10. This suggests that the dataset has several subgroups within the population, each characterized by distinct dietary habits or patterns as measured by the KIDMED index, which assesses adherence to the Mediterranean diet. The distribution is discrete, reflecting integer scores that children have received based on their dietary intake. The modes indicate the most common dietary patterns, suggesting possible clusters of dietary behavior among the children sampled.
The second histogram depicts the distribution of clean and over-reported moderate-to-vigorous physical activity (MVPA) in minutes per day. This histogram shows a right-skewed distribution, indicating that most children report lower levels of physical activity, with a smaller number of children reporting very high levels of activity, which might be over-reported. The peak near the lower end suggests that a significant portion of the sample engages in minimal to moderate amounts of MVPA, while the long tail to the right hints at a few cases with unusually high reported values, possibly due to over-reporting or measurement errors in data collection.
For sedentary behavior in minutes per day, there is a distribution that is slightly left-skewed in the histogram. Most children tend to have higher sedentary time, with a concentration of values towards the right side of the histogram. The distribution suggests that fewer children engage in lower levels of sedentary behavior, indicating a trend towards more inactivity among the sample. This pattern might raise concerns regarding lifestyle habits that contribute to prolonged periods of low physical activity.
The distribution of total hours of sleep per night (averaged over weekdays and weekends) exhibits a nearly normal distribution. This suggests that most children in the study have a consistent sleep duration with the bulk of the data clustering around the mean. The symmetry of the distribution indicates a healthy variance in sleep hours among the children, without significant extremes in either insufficient or excessive sleep, which is a positive indication of regular sleep patterns in this population.
categorical_lifestyle <- lifestyle_exposome %>%
select(where(is.factor))
categorical_lifestyle_long <- pivot_longer(
categorical_lifestyle,
cols = everything(),
names_to = "variable",
values_to = "value"
)
unique_categorical_vars <- unique(categorical_lifestyle_long$variable)
categorical_plots <- lapply(unique_categorical_vars, function(var) {
data <- filter(categorical_lifestyle_long, variable == var)
p <- ggplot(data, aes(x = value, fill = value)) +
geom_bar(stat = "count") +
labs(title = paste("Distribution of", var), x = var, y = "Count")
print(p)
return(p)
})
Breastfeeding Duration: Majority of observations are in the highest duration category, suggesting longer breastfeeding periods are common.
Bakery Products: Shows a relatively even distribution across the three categories, indicating varied consumption levels of bakery products among participants.
Beverages: A significant number of participants consume beverages at the highest level, indicating a preference or higher consumption of beverages like sodas.
Breakfast Cereal: The highest category of cereal consumption is the most common, suggesting a preference for or greater consumption of cereals.
Caffeinated/Energy Drinks: Displays a high number of participants avoiding or consuming very low quantities of caffeinated or energy drinks.
Dairy: Shows a fairly even distribution across all categories, indicating a uniform consumption pattern of dairy products.
Fast Food: Most participants fall into the middle category, indicating moderate consumption of fast food.
Organic Food: Most participants either consume a lot of or no organic food, with fewer in the middle range.
Processed Meat: Consumption levels are fairly evenly distributed, indicating varied dietary habits regarding processed meats.
Ready-Made Meals: Many participants rarely consume ready-made meals, with a significant number also in the highest consumption category.
Bread: Distribution shows a significant leaning towards higher bread consumption.
Cereal: Even distribution across categories suggests varied cereal consumption habits.
Fish and Seafood: Even distribution across categories, indicating varied consumption of fish and seafood.
Fruits: High fruit consumption is the most common, with fewer participants in the lowest category.
Added Fats: More participants consume added fats at the lowest and highest levels, with fewer in the middle.
Meat: Consumption of meat is highest in the middle category.
Potatoes: Shows a tendency towards either low or high consumption, with fewer people in the middle range.
Sweets: High consumption of sweets is the most common, indicating a preference for or higher access to sugary foods.
Vegetables: Most participants consume a high amount of vegetables.
Yogurt: Shows a preference for either very high or very low yogurt consumption, with fewer participants in the middle.
numeric_lifestyle <- select_if(lifestyle_exposome, is.numeric)
cor_matrix <- cor(numeric_lifestyle, method = "pearson")
cor_matrix <- cor(numeric_lifestyle, method = "spearman")
corrplot(cor_matrix, method = "circle")
Chemical_Exposures <- filtered_codebook$variable_name[filtered_codebook$domain=="Chemicals"]
chemical_exposome <- exposome %>%
select(all_of(Chemical_Exposures))
summarytools::view(dfSummary(chemical_exposome, style = 'grid', plain.ascii = FALSE, valid.col = FALSE, headings = FALSE), method = "render")
| No | Variable | Stats / Values | Freqs (% of Valid) | Graph | Missing | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | hs_as_c_Log2 [numeric] |
|
692 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | hs_cd_c_Log2 [numeric] |
|
695 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | hs_co_c_Log2 [numeric] |
|
317 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | hs_cs_c_Log2 [numeric] |
|
369 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | hs_cu_c_Log2 [numeric] |
|
345 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | hs_hg_c_Log2 [numeric] |
|
698 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | hs_mn_c_Log2 [numeric] |
|
457 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | hs_mo_c_Log2 [numeric] |
|
593 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | hs_pb_c_Log2 [numeric] |
|
529 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | hs_tl_cdich_None [factor] |
|
|
0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | hs_dde_cadj_Log2 [numeric] |
|
1050 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | hs_ddt_cadj_Log2 [numeric] |
|
1039 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | hs_hcb_cadj_Log2 [numeric] |
|
1036 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | hs_pcb118_cadj_Log2 [numeric] |
|
1048 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | hs_pcb138_cadj_Log2 [numeric] |
|
1031 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | hs_pcb153_cadj_Log2 [numeric] |
|
1047 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | hs_pcb170_cadj_Log2 [numeric] |
|
1039 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | hs_pcb180_cadj_Log2 [numeric] |
|
1055 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | hs_sumPCBs5_cadj_Log2 [numeric] |
|
1052 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | hs_dep_cadj_Log2 [numeric] |
|
1045 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | hs_detp_cadj_Log2 [numeric] |
|
1036 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | hs_dmdtp_cdich_None [factor] |
|
|
0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | hs_dmp_cadj_Log2 [numeric] |
|
1053 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | hs_dmtp_cadj_Log2 [numeric] |
|
1057 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | hs_pbde153_cadj_Log2 [numeric] |
|
1036 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | hs_pbde47_cadj_Log2 [numeric] |
|
1010 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | hs_pfhxs_c_Log2 [numeric] |
|
1061 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | hs_pfna_c_Log2 [numeric] |
|
1031 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | hs_pfoa_c_Log2 [numeric] |
|
1061 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | hs_pfos_c_Log2 [numeric] |
|
1050 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | hs_pfunda_c_Log2 [numeric] |
|
1044 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | hs_bpa_cadj_Log2 [numeric] |
|
1056 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | hs_bupa_cadj_Log2 [numeric] |
|
1034 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | hs_etpa_cadj_Log2 [numeric] |
|
1066 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | hs_mepa_cadj_Log2 [numeric] |
|
1052 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | hs_oxbe_cadj_Log2 [numeric] |
|
1069 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | hs_prpa_cadj_Log2 [numeric] |
|
1031 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | hs_trcs_cadj_Log2 [numeric] |
|
1053 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | hs_mbzp_cadj_Log2 [numeric] |
|
1046 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | hs_mecpp_cadj_Log2 [numeric] |
|
1037 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | hs_mehhp_cadj_Log2 [numeric] |
|
1050 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | hs_mehp_cadj_Log2 [numeric] |
|
1035 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | hs_meohp_cadj_Log2 [numeric] |
|
1057 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | hs_mep_cadj_Log2 [numeric] |
|
1075 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | hs_mibp_cadj_Log2 [numeric] |
|
1057 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | hs_mnbp_cadj_Log2 [numeric] |
|
1048 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | hs_ohminp_cadj_Log2 [numeric] |
|
1085 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | hs_oxominp_cadj_Log2 [numeric] |
|
1059 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | hs_sumDEHP_cadj_Log2 [numeric] |
|
1028 distinct values | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | FAS_cat_None [factor] |
|
|
0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | hs_contactfam_3cat_num_None [factor] |
|
|
0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | hs_hm_pers_None [numeric] |
|
|
0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | hs_participation_3cat_None [factor] |
|
|
0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | hs_cotinine_cdich_None [factor] |
|
|
0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | hs_globalexp2_None [factor] |
|
|
0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | hs_smk_parents_None [factor] |
|
|
0 (0.0%) |
Generated by summarytools 1.0.1 (R version 4.4.0)
2024-06-17
#separate numeric and categorical data
numeric_chemical <- chemical_exposome %>%
select(where(is.numeric))
numeric_chemical_long <- pivot_longer(
numeric_chemical,
cols = everything(),
names_to = "variable",
values_to = "value"
)
unique_numerical_vars <- unique(numeric_chemical_long$variable)
num_plots <- lapply(unique_numerical_vars, function(var) {
data <- filter(numeric_chemical_long, variable == var)
p <- ggplot(data, aes(x = value)) +
geom_histogram(bins = 30, fill = "blue") +
labs(title = paste("Histogram of", var), x = "Value", y = "Count")
print(p)
return(p)
})
Arsenic (hs_as_c_Log2): This histogram shows a bimodal distribution of arsenic levels, with two prominent peaks. Such a distribution might suggest two different populations or sources of exposure among the study participants.
Cadmium (hs_cd_c_Log2): The distribution of cadmium levels is skewed to the right, indicating that most participants have lower exposure levels, with a few cases showing significantly higher exposures.
Cobalt (hs_co_c_Log2): The histogram of cobalt levels displays a roughly normal distribution centered around a slight positive skew. This suggests a common source of exposure with varying levels among the population.
Cesium (hs_cs_c_Log2): Exhibits a right-skewed distribution, indicating that most participants have relatively low exposure levels, but a small number have substantially higher exposures.
Copper (hs_cu_c_Log2): Shows a right-skewed distribution, suggesting that while most individuals have moderate exposure, a few experience significantly higher levels of copper.
Mercury (hs_hg_c_Log2): This distribution is also right-skewed, common for environmental pollutants, where a majority have lower exposure levels, and a minority have high exposure levels.
Manganese (hs_mn_c_Log2): The histogram for manganese displays a bell-shaped distribution, indicating a normal distribution of manganese levels among the participants.
Molybdenum (hs_mo_c_Log2): Shows a distribution with a sharp peak and a long right tail, suggesting that while most people have similar exposure levels, a few have exceptionally high exposures.
Lead (hs_pb_c_Log2): The distribution is slightly right-skewed, indicating higher exposure levels in a smaller group of the population compared to the majority.
DDE (hs_dde_cadj_Log2): Shows a pronounced right skew, typical for chemicals that accumulate in the environment and in human tissues, indicating higher levels of exposure in a smaller subset of the population.
DDT (hs_ddt_cadj_Log2): This histogram displays a multi-modal distribution, suggesting different sources or durations of exposure among the population.
Hexachlorobenzene (hs_hcb_cadj_Log2): Exhibits a right-skewed distribution with a long tail, indicating that most people have lower exposure levels with some outliers experiencing very high exposures.
PCB 118, 138, 153 (hs_pcb118_cadj_Log2, hs_pcb138_cadj_Log2, hs_pcb153_cadj_Log2): All three PCBs show similar distributions with right skewness, suggesting that exposure to these compounds is higher among a smaller segment of the population.
PCB 170 and PCB 180: Both histograms show a significant right skew, indicating lower concentrations of these chemicals in most samples, with fewer samples showing higher concentrations. This pattern suggests that while most individuals have low exposure, a few may have considerably higher levels.
Sum of PCBs: The histogram is approximately normally distributed, centered around a higher value compared to individual PCBs, indicating a collective higher average exposure when all measured PCBs are considered together.
DEP, DETP, DMTP, DMDTP, PBDE 153, and PBDE 47: These histograms mostly show multimodal distributions (more than one peak), suggesting different exposure sources or groups within the population that have distinct exposure levels. The multiple peaks could indicate varied exposure pathways or differences in how these chemicals are metabolized or retained in the body.
PFHxS, PFNA, and PFOA: These perfluorinated compounds display a roughly normal distribution skewed right, suggesting a common source of exposure among the population, but with some individuals experiencing higher exposures.
PFOS and PFUnDA: The histograms show a single, sharp peak with a rapid decline, indicating that most individuals have similar exposure levels, likely due to common environmental sources or regulatory controls limiting variability.
BPA: The histogram is sharply peaked near zero with a long tail to the right, indicating low exposure for most individuals but significant exposure for a few, possibly due to specific product use or occupational exposure.
MBZP (Monobenzyl Phthalate): This histogram shows a right-skewed distribution. Most values cluster at the lower end, indicating a common lower exposure level among subjects, with a long tail towards higher values suggesting occasional higher exposures.
MECPP (Mono-ethyl hexyl phthalate): The distribution is right-skewed, similar to MBZP, but with a smoother decline. This pattern also indicates that while most subjects have lower exposure levels, a few experience significantly higher exposures.
MEHHP (Mono-2-ethyl-5-hydroxyhexyl phthalate): Exhibits a unimodal distribution with a peak around a middle value and symmetric tails. This could indicate a more standardized exposure level among the subjects with some variation.
MEHP (Mono-ethylhexyl phthalate):Another right-skewed distribution, indicating that most subjects have lower exposure levels but a few have much higher levels.
MEOHP (Mono-2-ethyl-5-oxohexyl phthalate): This histogram shows a distribution with a peak around the middle values and a tail extending towards higher values, suggesting a central tendency with some higher exposures.
MEP (Mono-ethyl phthalate): The distribution is right-skewed, similar to others, showing most subjects with low to moderate levels of exposure, but a few have much higher levels.
OXINP (Oxidized Isoparaffin): This histogram shows a central peak with a fast decline, indicating a concentration of values around a specific point which might suggest a common exposure level among the subjects.
Sum of DEHP Metabolites: This shows a broad distribution with a peak towards the lower end, indicating varied exposure levels among the subjects, with most experiencing lower exposures.
Personal Care Product Use: The histogram displays a highly skewed distribution with multiple peaks, reflecting varied usage patterns among subjects, with some showing particularly high usage levels.
categorical_chemical <- chemical_exposome %>%
select(where(is.factor))
categorical_chemical_long <- pivot_longer(
categorical_chemical,
cols = everything(),
names_to = "variable",
values_to = "value"
)
unique_categorical_vars <- unique(categorical_chemical_long$variable)
categorical_plots <- lapply(unique_categorical_vars, function(var) {
data <- filter(categorical_chemical_long, variable == var)
p <- ggplot(data, aes(x = value, fill = value)) +
geom_bar(stat = "count") +
labs(title = paste("Distribution of", var), x = var, y = "Count")
print(p)
return(p)
})
hs_t_cdich_None (Detected vs. Undetected):The vast majority of samples were undetected for this particular chemical, with only a small fraction showing detection.
hs_dmdtp_cdich_None (Detected vs. Undetected): Similar to the previous, most samples were undetected, but a higher proportion shows detection compared to the first chemical.
FAS_cat_None (Family Affluence Scale categories - Low, Middle, High): This shows the distribution of family affluence categories where the largest group is the high affluence, followed by middle, with the fewest in the low category.
hs_contactfam_3cat_num_None (Frequency of contact with family): Most individuals reported daily (almost daily) contact with family, a smaller number reported weekly contact, and the fewest reported less frequent than weekly contact.
hs_participation_3cat_None (Participation in organisations): A large number of individuals do not participate in any organisation, a substantial number participate in one, and a smaller group in two or more.
hs_cotinine_cdich_None (Detected vs. Undetected): Cotinine detection is high, indicating exposure to nicotine, with a significant number of samples showing detection versus undetected.
hs_globalexp2_None (Global Exposure - Exposure vs. No Exposure): This represents overall exposure to some condition or factor, with a larger proportion having no exposure compared to those with exposure.
hs_smk_parents_None (Smoking status of parents - Both, Neither, One): The largest group reported that neither parent smokes, a significant number reported one smoking parent, and the smallest group reported both parents smoke.
numeric_chemical <- select_if(chemical_exposome, is.numeric)
cor_matrix <- cor(numeric_chemical, method = "pearson")
cor_matrix <- cor(numeric_chemical, method = "spearman")
custom_color_scale <- list(
c(0, "darkred"),
c(0.5, "white"),
c(1, "darkblue")
)
plot_ly(
z = cor_matrix,
x = colnames(cor_matrix),
y = colnames(cor_matrix),
type = "heatmap",
colorscale = custom_color_scale
) %>%
layout(
title = "Correlation Matrix",
xaxis = list(tickangle = -90),
yaxis = list(side = "left")
)
summarytools::view(dfSummary(covariates, style = 'grid', plain.ascii = FALSE, valid.col = FALSE, headings = FALSE), method = "render")
| No | Variable | Stats / Values | Freqs (% of Valid) | Graph | Missing | |||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | ID [integer] |
|
1301 distinct values (Integer sequence) | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||
| 2 | h_cohort [factor] |
|
|
0 (0.0%) | ||||||||||||||||||||||||||||||||||||
| 3 | e3_sex_None [factor] |
|
|
0 (0.0%) | ||||||||||||||||||||||||||||||||||||
| 4 | e3_yearbir_None [factor] |
|
|
0 (0.0%) | ||||||||||||||||||||||||||||||||||||
| 5 | h_mbmi_None [numeric] |
|
853 distinct values | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||
| 6 | hs_wgtgain_None [numeric] |
|
49 distinct values | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||
| 7 | e3_gac_None [numeric] |
|
72 distinct values | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||
| 8 | h_age_None [numeric] |
|
665 distinct values | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||
| 9 | h_edumc_None [factor] |
|
|
0 (0.0%) | ||||||||||||||||||||||||||||||||||||
| 10 | h_native_None [factor] |
|
|
0 (0.0%) | ||||||||||||||||||||||||||||||||||||
| 11 | h_parity_None [factor] |
|
|
0 (0.0%) | ||||||||||||||||||||||||||||||||||||
| 12 | hs_child_age_None [numeric] |
|
879 distinct values | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||
| 13 | hs_c_height_None [numeric] |
|
311 distinct values | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||
| 14 | hs_c_weight_None [numeric] |
|
311 distinct values | 0 (0.0%) |
Generated by summarytools 1.0.1 (R version 4.4.0)
2024-06-17
#separate numeric and categorical data
numeric_covariates <- covariates %>%
select(where(is.numeric))
numeric_covariates_long <- pivot_longer(
numeric_covariates,
cols = everything(),
names_to = "variable",
values_to = "value"
)
unique_numerical_vars <- unique(numeric_covariates_long$variable)
num_plots <- lapply(unique_numerical_vars, function(var) {
data <- filter(numeric_covariates_long, variable == var)
p <- ggplot(data, aes(x = value)) +
geom_histogram(bins = 30, fill = "blue") +
labs(title = paste("Histogram of", var), x = "Value", y = "Count")
print(p)
return(p)
})
ID: This histogram appears to show a uniform distribution of IDs over a range, with all IDs evenly spaced. This typical pattern is expected in a dataset where IDs are systematically assigned.
Maternal BMI (h_mbmi): The distribution of maternal BMI is roughly normal but slightly right-skewed, indicating that more individuals are on the higher side of the BMI scale. The peak of the histogram around the 25-30 range suggests a concentration of values in this area, which is typical for adult populations.
Weight Gain (hs_wgtgain): This histogram displays a bimodal distribution of weight gain, with significant peaks around 10 and another around 20. This could indicate two common patterns or recommendations in weight gain during pregnancy or another health-related period.
Gestational Age at Childbirth (e3_gac): The distribution is centered around the 40-week mark, which is typical for full-term pregnancies. There is a sharp peak at around 40 weeks, showing that most childbirths occur at this gestational age.
Maternal Age (h_age): This histogram shows a roughly normal distribution with a peak around the early 30s, suggesting that this is the most common age range for the mothers in the dataset.
Child’s Age (hs_child_age): This histogram is multimodal, reflecting several peaks across different ages. This could be indicative of the data collection points or particular age groups being studied.
Child’s Height (hs_c_height): The data is approximately normally distributed with a slight right skew. The majority of the measurements cluster around the mean, which suggests typical growth patterns.
Child’s Weight (hs_c_weight): This histogram is right-skewed, indicating that while most children’s weights are within a normal range, there is a long tail of children who weigh more, which might suggest variations in growth or cases of overweight.
categorical_covariates <- covariates %>%
select(where(is.factor))
categorical_covariates_long <- pivot_longer(
categorical_covariates,
cols = everything(),
names_to = "variable",
values_to = "value"
)
unique_categorical_vars <- unique(categorical_covariates_long$variable)
categorical_plots <- lapply(unique_categorical_vars, function(var) {
data <- filter(categorical_covariates_long, variable == var)
p <- ggplot(data, aes(x = value, fill = value)) +
geom_bar(stat = "count") +
labs(title = paste("Distribution of", var), x = var, y = "Count")
print(p)
return(p)
})
Cohorts (h_cohort): The distribution shows the count of subjects across six different cohorts. All cohorts have a substantial number of subjects, with cohort 5 showing the highest participation.
Gender Distribution (e3_sex): The gender distribution is nearly balanced with a slight higher count for males compared to females.
Year of Birth (e3_yearbir): This chart shows that the majority of subjects were born in the later years, with a significant increase in 2009, indicating perhaps a larger recruitment or a specific cohort focus that year.
Educational Level (h_educmc): Represents three categories of educational attainment, with category 3 having the highest count, suggesting a higher level of education among the majority of the subjects.
Native Language (h_native): Shows the count of subjects by their native language status. The majority are from category 2, which could represent a specific linguistic or demographic group.
Parity (h_parity): The chart categorizes subjects based on the number of children they have. The largest group is those with no children, followed by those with one child, and a smaller group with two children.
numeric_covariate <- select_if(covariates, is.numeric)
cor_matrix <- cor(numeric_covariate, method = "pearson")
cor_matrix <- cor(numeric_covariate, method = "spearman")
corrplot(cor_matrix, method = "circle")
outcome_BMI <- phenotype %>%
select(hs_zbmi_who)
summarytools::view(dfSummary(outcome_BMI, style = 'grid', plain.ascii = FALSE, valid.col = FALSE, headings = FALSE), method = "render")
| No | Variable | Stats / Values | Freqs (% of Valid) | Graph | Missing | ||||
|---|---|---|---|---|---|---|---|---|---|
| 1 | hs_zbmi_who [numeric] |
|
421 distinct values | 0 (0.0%) |
Generated by summarytools 1.0.1 (R version 4.4.0)
2024-06-17
outcome_cov <- cbind(covariates, outcome_BMI)
outcome_cov <- outcome_cov[, !duplicated(colnames(outcome_cov))]
outcome_cov <- outcome_cov %>%
select(ID, hs_child_age_None, h_cohort, e3_sex_None, e3_yearbir_None, h_edumc_None, h_native_None, h_parity_None, hs_zbmi_who)
summary_table <- dfSummary(outcome_cov,
varnumbers = TRUE,
valid.col = FALSE,
graph.col = TRUE,
style = "multiline")
print(summary_table, method = "render", plain.ascii = FALSE, style = "grid")
| No | Variable | Stats / Values | Freqs (% of Valid) | Graph | Missing | |||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | ID [integer] |
|
1301 distinct values (Integer sequence) | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||
| 2 | hs_child_age_None [numeric] |
|
879 distinct values | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||
| 3 | h_cohort [factor] |
|
|
0 (0.0%) | ||||||||||||||||||||||||||||||||||||
| 4 | e3_sex_None [factor] |
|
|
0 (0.0%) | ||||||||||||||||||||||||||||||||||||
| 5 | e3_yearbir_None [factor] |
|
|
0 (0.0%) | ||||||||||||||||||||||||||||||||||||
| 6 | h_edumc_None [factor] |
|
|
0 (0.0%) | ||||||||||||||||||||||||||||||||||||
| 7 | h_native_None [factor] |
|
|
0 (0.0%) | ||||||||||||||||||||||||||||||||||||
| 8 | h_parity_None [factor] |
|
|
0 (0.0%) | ||||||||||||||||||||||||||||||||||||
| 9 | hs_zbmi_who [numeric] |
|
421 distinct values | 0 (0.0%) |
Generated by summarytools 1.0.1 (R version 4.4.0)
2024-06-17
#chemicals considered? would it be too small?
chemicals <- c(
"hs_bpa_cadj_Log2", # Bisphenol A, known for endocrine disruption
"hs_pcb118_cadj_Log2", # PCB 118, a type of polychlorinated biphenyl
"hs_pcb138_cadj_Log2", # PCB 138
"hs_pcb153_cadj_Log2", # PCB 153
"hs_pcb170_cadj_Log2", # PCB 170
"hs_pcb180_cadj_Log2", # PCB 180
"hs_pb_c_Log2", # Lead, associated with numerous health issues
"hs_cd_c_Log2", # Cadmium, linked to kidney damage and obesity
"hs_ddt_cadj_Log2", # DDT, an organochlorine pesticide
"hs_dde_cadj_Log2" # DDE, a breakdown product of DDT
)
#the full chemicals list
chemicals_full <- c(
"hs_as_c_Log2",
"hs_cd_c_Log2",
"hs_co_c_Log2",
"hs_cs_c_Log2",
"hs_cu_c_Log2",
"hs_hg_c_Log2",
"hs_mn_c_Log2",
"hs_mo_c_Log2",
"hs_pb_c_Log2",
"hs_tl_cdich_None",
"hs_dde_cadj_Log2",
"hs_ddt_cadj_Log2",
"hs_hcb_cadj_Log2",
"hs_pcb118_cadj_Log2",
"hs_pcb138_cadj_Log2",
"hs_pcb153_cadj_Log2",
"hs_pcb170_cadj_Log2",
"hs_pcb180_cadj_Log2",
"hs_dep_cadj_Log2",
"hs_detp_cadj_Log2",
"hs_dmdtp_cdich_None",
"hs_dmp_cadj_Log2",
"hs_dmtp_cadj_Log2",
"hs_pbde153_cadj_Log2",
"hs_pbde47_cadj_Log2",
"hs_pfhxs_c_Log2",
"hs_pfna_c_Log2",
"hs_pfoa_c_Log2",
"hs_pfos_c_Log2",
"hs_pfunda_c_Log2",
"hs_bpa_cadj_Log2",
"hs_bupa_cadj_Log2",
"hs_etpa_cadj_Log2",
"hs_mepa_cadj_Log2",
"hs_oxbe_cadj_Log2",
"hs_prpa_cadj_Log2",
"hs_trcs_cadj_Log2",
"hs_mbzp_cadj_Log2",
"hs_mecpp_cadj_Log2",
"hs_mehhp_cadj_Log2",
"hs_mehp_cadj_Log2",
"hs_meohp_cadj_Log2",
"hs_mep_cadj_Log2",
"hs_mibp_cadj_Log2",
"hs_mnbp_cadj_Log2",
"hs_ohminp_cadj_Log2",
"hs_oxominp_cadj_Log2",
"FAS_cat_None",
"hs_contactfam_3cat_num_None",
"hs_hm_pers_None",
"hs_participation_3cat_None",
"hs_cotinine_cdich_None",
"hs_globalexp2_None",
"hs_smk_parents_None"
)
#postnatal diet for child
postnatal_diet <- c(
"h_bfdur_Ter",
"hs_bakery_prod_Ter",
"hs_beverages_Ter",
"hs_break_cer_Ter",
"hs_caff_drink_Ter",
"hs_dairy_Ter",
"hs_fastfood_Ter",
"h_legume_preg_Ter",
"hs_org_food_Ter",
"hs_proc_meat_Ter",
"hs_readymade_Ter",
"hs_total_bread_Ter",
"hs_total_cereal_Ter",
"hs_total_fish_Ter",
"hs_total_fruits_Ter",
"hs_total_lipids_Ter",
"hs_total_meat_Ter",
"hs_total_potatoes_Ter",
"hs_total_sweets_Ter",
"hs_total_veg_Ter",
"hs_total_yog_Ter"
)
all_columns <- c(chemicals_full, postnatal_diet)
extracted_exposome <- exposome %>% select(all_of(all_columns))
head(extracted_exposome)
selected_data <- cbind(outcome_cov, extracted_exposome)
head(selected_data)
selected_data <- select_if(selected_data, is.numeric)
cor_matrix <- cor(selected_data, method = "pearson")
cor_matrix <- cor(selected_data, method = "spearman")
custom_color_scale <- list(
c(0, "darkred"),
c(0.5, "white"),
c(1, "darkblue")
)
plot_ly(
z = cor_matrix,
x = colnames(cor_matrix),
y = colnames(cor_matrix),
type = "heatmap",
colorscale = custom_color_scale
) %>%
layout(
title = "Correlation Matrix",
xaxis = list(tickangle = -90),
yaxis = list(side = "left")
)
set.seed(101)
sample_size <- floor(0.7 * nrow(selected_data)) #70-30 split
train_indices <- sample(seq_len(nrow(selected_data)), size = sample_size)
train_set <- selected_data[train_indices, ]
validation_set <- selected_data[-train_indices, ]
y_train <- train_set$hs_zbmi_who
X_train <- as.matrix(train_set[, setdiff(names(train_set), "hs_zbmi_who")]) # predictor matrix for training
# fit the LASSO model
lasso_model <- glmnet(X_train, y_train, alpha = 1) # alpha = 1 for LASSO
set.seed(101)
cv_lasso <- cv.glmnet(X_train, y_train, alpha = 1, type.measure = "mse", nfolds = 10)
plot(cv_lasso)
best_lambda <- cv_lasso$lambda.min # lambda that minimizes the MSE
coef(cv_lasso, s = best_lambda) # coefficients at the chosen lambda
## 49 x 1 sparse Matrix of class "dgCMatrix"
## s1
## (Intercept) -4.701033e+00
## ID -6.071046e-05
## hs_child_age_None -6.338641e-02
## hs_as_c_Log2 1.875199e-03
## hs_cd_c_Log2 -3.380409e-02
## hs_co_c_Log2 -4.436911e-02
## hs_cs_c_Log2 1.881293e-01
## hs_cu_c_Log2 7.174674e-01
## hs_hg_c_Log2 -2.602018e-02
## hs_mn_c_Log2 -2.222827e-02
## hs_mo_c_Log2 -1.303466e-01
## hs_pb_c_Log2 -3.371033e-02
## hs_dde_cadj_Log2 -6.599626e-02
## hs_ddt_cadj_Log2 7.981771e-04
## hs_hcb_cadj_Log2 .
## hs_pcb118_cadj_Log2 1.333631e-02
## hs_pcb138_cadj_Log2 .
## hs_pcb153_cadj_Log2 -1.758703e-01
## hs_pcb170_cadj_Log2 -6.391508e-02
## hs_pcb180_cadj_Log2 .
## hs_dep_cadj_Log2 -2.681785e-02
## hs_detp_cadj_Log2 4.388681e-03
## hs_dmp_cadj_Log2 .
## hs_dmtp_cadj_Log2 .
## hs_pbde153_cadj_Log2 -3.783185e-02
## hs_pbde47_cadj_Log2 3.797115e-03
## hs_pfhxs_c_Log2 .
## hs_pfna_c_Log2 3.148344e-02
## hs_pfoa_c_Log2 -1.936730e-01
## hs_pfos_c_Log2 -6.102896e-02
## hs_pfunda_c_Log2 4.136132e-03
## hs_bpa_cadj_Log2 .
## hs_bupa_cadj_Log2 .
## hs_etpa_cadj_Log2 .
## hs_mepa_cadj_Log2 -1.633098e-02
## hs_oxbe_cadj_Log2 8.200837e-03
## hs_prpa_cadj_Log2 1.230135e-02
## hs_trcs_cadj_Log2 .
## hs_mbzp_cadj_Log2 8.074216e-02
## hs_mecpp_cadj_Log2 .
## hs_mehhp_cadj_Log2 .
## hs_mehp_cadj_Log2 .
## hs_meohp_cadj_Log2 .
## hs_mep_cadj_Log2 .
## hs_mibp_cadj_Log2 -6.759105e-02
## hs_mnbp_cadj_Log2 -5.144897e-02
## hs_ohminp_cadj_Log2 -1.747015e-02
## hs_oxominp_cadj_Log2 8.276140e-03
## hs_hm_pers_None -2.462955e-02
y_validation <- validation_set$hs_zbmi_who # response variable for validation
X_validation <- as.matrix(validation_set[, setdiff(names(validation_set), "hs_zbmi_who")]) # predictor matrix for validation
predictions <- predict(lasso_model, s = best_lambda, newx = X_validation)
mse_lasso <- mean((predictions - y_validation)^2) # calculate Mean Squared Error on validation data
print(paste("MSE on validation set: ", mse_lasso))
## [1] "MSE on validation set: 1.22144229997241"
coef(lasso_model, s = best_lambda)
## 49 x 1 sparse Matrix of class "dgCMatrix"
## s1
## (Intercept) -4.701033e+00
## ID -6.071046e-05
## hs_child_age_None -6.338641e-02
## hs_as_c_Log2 1.875199e-03
## hs_cd_c_Log2 -3.380409e-02
## hs_co_c_Log2 -4.436911e-02
## hs_cs_c_Log2 1.881293e-01
## hs_cu_c_Log2 7.174674e-01
## hs_hg_c_Log2 -2.602018e-02
## hs_mn_c_Log2 -2.222827e-02
## hs_mo_c_Log2 -1.303466e-01
## hs_pb_c_Log2 -3.371033e-02
## hs_dde_cadj_Log2 -6.599626e-02
## hs_ddt_cadj_Log2 7.981771e-04
## hs_hcb_cadj_Log2 .
## hs_pcb118_cadj_Log2 1.333631e-02
## hs_pcb138_cadj_Log2 .
## hs_pcb153_cadj_Log2 -1.758703e-01
## hs_pcb170_cadj_Log2 -6.391508e-02
## hs_pcb180_cadj_Log2 .
## hs_dep_cadj_Log2 -2.681785e-02
## hs_detp_cadj_Log2 4.388681e-03
## hs_dmp_cadj_Log2 .
## hs_dmtp_cadj_Log2 .
## hs_pbde153_cadj_Log2 -3.783185e-02
## hs_pbde47_cadj_Log2 3.797115e-03
## hs_pfhxs_c_Log2 .
## hs_pfna_c_Log2 3.148344e-02
## hs_pfoa_c_Log2 -1.936730e-01
## hs_pfos_c_Log2 -6.102896e-02
## hs_pfunda_c_Log2 4.136132e-03
## hs_bpa_cadj_Log2 .
## hs_bupa_cadj_Log2 .
## hs_etpa_cadj_Log2 .
## hs_mepa_cadj_Log2 -1.633098e-02
## hs_oxbe_cadj_Log2 8.200837e-03
## hs_prpa_cadj_Log2 1.230135e-02
## hs_trcs_cadj_Log2 .
## hs_mbzp_cadj_Log2 8.074216e-02
## hs_mecpp_cadj_Log2 .
## hs_mehhp_cadj_Log2 .
## hs_mehp_cadj_Log2 .
## hs_meohp_cadj_Log2 .
## hs_mep_cadj_Log2 .
## hs_mibp_cadj_Log2 -6.759105e-02
## hs_mnbp_cadj_Log2 -5.144897e-02
## hs_ohminp_cadj_Log2 -1.747015e-02
## hs_oxominp_cadj_Log2 8.276140e-03
## hs_hm_pers_None -2.462955e-02
# fit the ridge model
ridge_model <- glmnet(X_train, y_train, alpha = 0) # alpha = 0 for ridge
set.seed(101)
cv_ridge <- cv.glmnet(X_train, y_train, alpha = 0, type.measure = "mse", nfolds = 10)
plot(cv_ridge)
best_lambda <- cv_ridge$lambda.min # lambda that minimizes the MSE
coef(cv_ridge, s = best_lambda) # coefficients at the chosen lambda
## 49 x 1 sparse Matrix of class "dgCMatrix"
## s1
## (Intercept) -3.6893683966
## ID -0.0000875941
## hs_child_age_None -0.0408581369
## hs_as_c_Log2 0.0060931533
## hs_cd_c_Log2 -0.0380475967
## hs_co_c_Log2 -0.0549892505
## hs_cs_c_Log2 0.1445507421
## hs_cu_c_Log2 0.5958899196
## hs_hg_c_Log2 -0.0287672133
## hs_mn_c_Log2 -0.0358722666
## hs_mo_c_Log2 -0.1114105848
## hs_pb_c_Log2 -0.0456775758
## hs_dde_cadj_Log2 -0.0554387236
## hs_ddt_cadj_Log2 0.0041990275
## hs_hcb_cadj_Log2 -0.0289326015
## hs_pcb118_cadj_Log2 0.0193595093
## hs_pcb138_cadj_Log2 -0.0350737053
## hs_pcb153_cadj_Log2 -0.1220395691
## hs_pcb170_cadj_Log2 -0.0515387116
## hs_pcb180_cadj_Log2 -0.0091209286
## hs_dep_cadj_Log2 -0.0253898515
## hs_detp_cadj_Log2 0.0074402926
## hs_dmp_cadj_Log2 -0.0017101423
## hs_dmtp_cadj_Log2 0.0011621132
## hs_pbde153_cadj_Log2 -0.0328446163
## hs_pbde47_cadj_Log2 0.0062650397
## hs_pfhxs_c_Log2 -0.0230471896
## hs_pfna_c_Log2 0.0262339174
## hs_pfoa_c_Log2 -0.1624009576
## hs_pfos_c_Log2 -0.0617921598
## hs_pfunda_c_Log2 0.0114534695
## hs_bpa_cadj_Log2 -0.0001930784
## hs_bupa_cadj_Log2 0.0063578496
## hs_etpa_cadj_Log2 -0.0060170476
## hs_mepa_cadj_Log2 -0.0169074648
## hs_oxbe_cadj_Log2 0.0105623661
## hs_prpa_cadj_Log2 0.0122497682
## hs_trcs_cadj_Log2 0.0034648131
## hs_mbzp_cadj_Log2 0.0611562541
## hs_mecpp_cadj_Log2 -0.0047393996
## hs_mehhp_cadj_Log2 0.0168477184
## hs_mehp_cadj_Log2 -0.0126130209
## hs_meohp_cadj_Log2 0.0087829207
## hs_mep_cadj_Log2 0.0066029934
## hs_mibp_cadj_Log2 -0.0564869439
## hs_mnbp_cadj_Log2 -0.0506415543
## hs_ohminp_cadj_Log2 -0.0316941861
## hs_oxominp_cadj_Log2 0.0242684720
## hs_hm_pers_None -0.0333783781
predictions <- predict(ridge_model, s = best_lambda, newx = X_validation)
mse_ridge <- mean((predictions - y_validation)^2) # calculate Mean Squared Error on validation data
print(paste("MSE on validation set: ", mse_ridge))
## [1] "MSE on validation set: 1.19013528522195"
coef(ridge_model, s = best_lambda)
## 49 x 1 sparse Matrix of class "dgCMatrix"
## s1
## (Intercept) -3.6893683966
## ID -0.0000875941
## hs_child_age_None -0.0408581369
## hs_as_c_Log2 0.0060931533
## hs_cd_c_Log2 -0.0380475967
## hs_co_c_Log2 -0.0549892505
## hs_cs_c_Log2 0.1445507421
## hs_cu_c_Log2 0.5958899196
## hs_hg_c_Log2 -0.0287672133
## hs_mn_c_Log2 -0.0358722666
## hs_mo_c_Log2 -0.1114105848
## hs_pb_c_Log2 -0.0456775758
## hs_dde_cadj_Log2 -0.0554387236
## hs_ddt_cadj_Log2 0.0041990275
## hs_hcb_cadj_Log2 -0.0289326015
## hs_pcb118_cadj_Log2 0.0193595093
## hs_pcb138_cadj_Log2 -0.0350737053
## hs_pcb153_cadj_Log2 -0.1220395691
## hs_pcb170_cadj_Log2 -0.0515387116
## hs_pcb180_cadj_Log2 -0.0091209286
## hs_dep_cadj_Log2 -0.0253898515
## hs_detp_cadj_Log2 0.0074402926
## hs_dmp_cadj_Log2 -0.0017101423
## hs_dmtp_cadj_Log2 0.0011621132
## hs_pbde153_cadj_Log2 -0.0328446163
## hs_pbde47_cadj_Log2 0.0062650397
## hs_pfhxs_c_Log2 -0.0230471896
## hs_pfna_c_Log2 0.0262339174
## hs_pfoa_c_Log2 -0.1624009576
## hs_pfos_c_Log2 -0.0617921598
## hs_pfunda_c_Log2 0.0114534695
## hs_bpa_cadj_Log2 -0.0001930784
## hs_bupa_cadj_Log2 0.0063578496
## hs_etpa_cadj_Log2 -0.0060170476
## hs_mepa_cadj_Log2 -0.0169074648
## hs_oxbe_cadj_Log2 0.0105623661
## hs_prpa_cadj_Log2 0.0122497682
## hs_trcs_cadj_Log2 0.0034648131
## hs_mbzp_cadj_Log2 0.0611562541
## hs_mecpp_cadj_Log2 -0.0047393996
## hs_mehhp_cadj_Log2 0.0168477184
## hs_mehp_cadj_Log2 -0.0126130209
## hs_meohp_cadj_Log2 0.0087829207
## hs_mep_cadj_Log2 0.0066029934
## hs_mibp_cadj_Log2 -0.0564869439
## hs_mnbp_cadj_Log2 -0.0506415543
## hs_ohminp_cadj_Log2 -0.0316941861
## hs_oxominp_cadj_Log2 0.0242684720
## hs_hm_pers_None -0.0333783781
# elastic net model
enet_model <- glmnet(X_train, y_train, alpha = 0.5) # alpha=0.5 for balanced enet
set.seed(101)
cv_enet <- cv.glmnet(X_train, y_train, alpha = 0.5, type.measure = "mse", nfolds = 10)
plot(cv_enet)
best_lambda_enet <- cv_enet$lambda.min
best_lambda_enet
## [1] 0.03091511
# predict on the validation set using the best lambda from CV
predictions_enet <- predict(enet_model, s = best_lambda_enet, newx = X_validation)
mse_enet <- mean((predictions_enet - y_validation)^2)
print(paste("MSE on validation set: ", mse_enet))
## [1] "MSE on validation set: 1.22045851890466"
coef(enet_model, s = best_lambda_enet)
## 49 x 1 sparse Matrix of class "dgCMatrix"
## s1
## (Intercept) -4.677167e+00
## ID -5.990942e-05
## hs_child_age_None -6.031258e-02
## hs_as_c_Log2 1.862157e-03
## hs_cd_c_Log2 -3.401494e-02
## hs_co_c_Log2 -4.327557e-02
## hs_cs_c_Log2 1.818873e-01
## hs_cu_c_Log2 7.092732e-01
## hs_hg_c_Log2 -2.554771e-02
## hs_mn_c_Log2 -2.134499e-02
## hs_mo_c_Log2 -1.283385e-01
## hs_pb_c_Log2 -3.296923e-02
## hs_dde_cadj_Log2 -6.438969e-02
## hs_ddt_cadj_Log2 7.727331e-04
## hs_hcb_cadj_Log2 .
## hs_pcb118_cadj_Log2 9.310417e-03
## hs_pcb138_cadj_Log2 .
## hs_pcb153_cadj_Log2 -1.733813e-01
## hs_pcb170_cadj_Log2 -6.317638e-02
## hs_pcb180_cadj_Log2 .
## hs_dep_cadj_Log2 -2.653581e-02
## hs_detp_cadj_Log2 4.351549e-03
## hs_dmp_cadj_Log2 .
## hs_dmtp_cadj_Log2 .
## hs_pbde153_cadj_Log2 -3.757815e-02
## hs_pbde47_cadj_Log2 3.484598e-03
## hs_pfhxs_c_Log2 .
## hs_pfna_c_Log2 2.907530e-02
## hs_pfoa_c_Log2 -1.901950e-01
## hs_pfos_c_Log2 -6.050339e-02
## hs_pfunda_c_Log2 3.844149e-03
## hs_bpa_cadj_Log2 .
## hs_bupa_cadj_Log2 .
## hs_etpa_cadj_Log2 .
## hs_mepa_cadj_Log2 -1.584749e-02
## hs_oxbe_cadj_Log2 8.198232e-03
## hs_prpa_cadj_Log2 1.192014e-02
## hs_trcs_cadj_Log2 .
## hs_mbzp_cadj_Log2 7.863514e-02
## hs_mecpp_cadj_Log2 .
## hs_mehhp_cadj_Log2 1.443904e-04
## hs_mehp_cadj_Log2 .
## hs_meohp_cadj_Log2 .
## hs_mep_cadj_Log2 .
## hs_mibp_cadj_Log2 -6.621600e-02
## hs_mnbp_cadj_Log2 -4.970805e-02
## hs_ohminp_cadj_Log2 -1.718262e-02
## hs_oxominp_cadj_Log2 8.146821e-03
## hs_hm_pers_None -2.461765e-02
set.seed(101)
rf_model <- randomForest(hs_zbmi_who ~ ., data = train_set, ntree = 500, mtry = sqrt(ncol(train_set)))
# evaluating the model
rf_predictions <- predict(rf_model, newdata = validation_set)
rf_mse <- mean((rf_predictions - validation_set$hs_zbmi_who)^2)
print(rf_mse)
## [1] 1.123737
# feature importance
importance(rf_model)
## IncNodePurity
## ID 19.733242
## hs_child_age_None 24.798571
## hs_as_c_Log2 21.768899
## hs_cd_c_Log2 24.474878
## hs_co_c_Log2 21.301472
## hs_cs_c_Log2 23.324936
## hs_cu_c_Log2 34.330569
## hs_hg_c_Log2 23.146393
## hs_mn_c_Log2 19.466026
## hs_mo_c_Log2 29.060283
## hs_pb_c_Log2 20.095046
## hs_dde_cadj_Log2 34.322032
## hs_ddt_cadj_Log2 26.535928
## hs_hcb_cadj_Log2 58.348335
## hs_pcb118_cadj_Log2 34.686041
## hs_pcb138_cadj_Log2 46.489485
## hs_pcb153_cadj_Log2 43.828546
## hs_pcb170_cadj_Log2 60.182708
## hs_pcb180_cadj_Log2 40.634585
## hs_dep_cadj_Log2 28.062097
## hs_detp_cadj_Log2 21.562980
## hs_dmp_cadj_Log2 22.847693
## hs_dmtp_cadj_Log2 19.447486
## hs_pbde153_cadj_Log2 51.348247
## hs_pbde47_cadj_Log2 21.347074
## hs_pfhxs_c_Log2 21.215388
## hs_pfna_c_Log2 23.671969
## hs_pfoa_c_Log2 35.640801
## hs_pfos_c_Log2 29.275573
## hs_pfunda_c_Log2 20.804239
## hs_bpa_cadj_Log2 21.969249
## hs_bupa_cadj_Log2 23.706344
## hs_etpa_cadj_Log2 21.137705
## hs_mepa_cadj_Log2 19.636963
## hs_oxbe_cadj_Log2 20.982596
## hs_prpa_cadj_Log2 24.911988
## hs_trcs_cadj_Log2 21.658289
## hs_mbzp_cadj_Log2 25.148887
## hs_mecpp_cadj_Log2 17.387630
## hs_mehhp_cadj_Log2 16.174195
## hs_mehp_cadj_Log2 16.243710
## hs_meohp_cadj_Log2 16.384440
## hs_mep_cadj_Log2 18.667212
## hs_mibp_cadj_Log2 21.225404
## hs_mnbp_cadj_Log2 22.240221
## hs_ohminp_cadj_Log2 26.755929
## hs_oxominp_cadj_Log2 18.956202
## hs_hm_pers_None 6.943009
varImpPlot(rf_model)
set.seed(101)
train_indices <- sample(1:nrow(selected_data), size = 0.7*nrow(selected_data))
train_set <- selected_data[train_indices, ]
test_set <- selected_data[-train_indices, ]
gbm_model <- gbm(hs_zbmi_who ~ .,
data = train_set,
distribution = "gaussian",
n.trees = 500,
interaction.depth = 4,
shrinkage = 0.01, # learning rate
cv.folds = 10, # 10-fold cross-validation
n.minobsinnode = 10
)
summary(gbm_model)
predictions <- predict(gbm_model, test_set, n.trees = gbm_model$n.trees)
mse_gbm <- mean((predictions - test_set$hs_zbmi_who)^2)
print(paste("Mean Squared Error: ", mse_gbm))
## [1] "Mean Squared Error: 1.11439391537488"
First 10 rows and columns of the metabolomic serum data
load("/Users/allison/Library/CloudStorage/GoogleDrive-aflouie@usc.edu/My Drive/HELIX_data/metabol_serum.RData")
kable(metabol_serum.d[1:10,1:10], align="c", digits=2, format="pipe")
| 430 | 1187 | 940 | 936 | 788 | 698 | 380 | 196 | 114 | 885 | |
|---|---|---|---|---|---|---|---|---|---|---|
| metab_1 | -2.15 | -0.69 | -0.69 | -0.19 | -1.96 | -1.90 | -0.22 | -1.38 | -0.54 | -1.25 |
| metab_2 | -0.71 | -0.37 | -0.36 | -0.34 | -0.35 | -0.63 | -0.26 | -0.46 | -0.44 | -0.48 |
| metab_3 | 8.60 | 9.15 | 8.95 | 8.54 | 8.73 | 8.24 | 9.03 | 8.29 | 8.37 | 8.18 |
| metab_4 | 0.55 | -1.33 | -0.13 | -0.62 | -0.80 | -0.46 | 0.49 | 0.12 | -0.76 | -0.07 |
| metab_5 | 7.05 | 6.89 | 7.10 | 7.01 | 6.90 | 6.94 | 6.77 | 6.62 | 6.85 | 7.24 |
| metab_6 | 5.79 | 5.81 | 5.86 | 5.95 | 5.95 | 5.42 | 5.82 | 5.65 | 5.44 | 5.60 |
| metab_7 | 3.75 | 4.26 | 4.35 | 4.24 | 4.88 | 4.70 | 4.08 | 4.73 | 3.98 | 4.30 |
| metab_8 | 5.07 | 5.08 | 5.92 | 5.41 | 5.39 | 4.62 | 5.10 | 5.28 | 4.51 | 5.45 |
| metab_9 | -1.87 | -2.30 | -1.97 | -1.89 | -1.55 | -1.78 | -2.29 | -1.64 | -2.02 | -1.68 |
| metab_10 | -2.77 | -3.42 | -3.40 | -2.84 | -2.45 | -3.14 | -3.36 | -2.88 | -3.05 | -2.92 |